function kt = assembleKt(elements,model)
mesh = model.getMesh();
nf = mesh.countFaces();
nDofs = mesh.countDofs();
kt = zeros(nDofs,nDofs);
for i=1:nf
    kte = computeKte(i,elements,model);
    dofs = mesh.getFace(i-1).getDofNumbers();
    len = size(dofs(:),1);
    for j=1:len
        for k=1:len
            if dofs(j)~=-1 && dofs(k)~=-1
                kt(dofs(j)+1,dofs(k)+1) = kt(dofs(j)+1,dofs(k)+1) + kte(j,k);
            end
        end
    end
end
end
